#include <map>
#include <string>
#include <ostream>
#include <iostream>
using namespace std;

template<typename con>
void display(const con & rhs){
    for(auto & ll : rhs)
    cout << "string = " << ll.first << "  Point = " << ll.second << endl; 
}

class Point{
public:
    Point(int x, int y)
    :_x(x)
    ,_y(y)
    {   }
    
    friend ostream & operator<<(ostream & os, const Point & rhs);
     

private:
    int _x;
    int _y;
};
// 
ostream & operator<<(ostream & os, const Point & rhs){
    os << "Point("
       << rhs._x << ", "
       << rhs._y << ")" 
       << endl;
    return os;
}

void test(){
    map<string,Point> mp = {
        {"nihao",Point(1,2)},
        {"wangdao",Point(-1,2)},
        {"aaa",Point(1,-2)},
        {"work",Point(3,4)},
        {"shengzheng",Point(1,2)}
    };

    display(mp);    

}

int main(int atgc, char * argv[])
{
    test();
    return 0;
}

